﻿@model AddProductToOrderModel

@if (Model.IsRental)
{
    //Actually just a copy (almost) of \Presentation\Nop.Web\Views\Product\_RentalInfo.cshtml
    <div class="card card-default">
        <div class="card-body">
            @{
                const string startDateControlId = "rental_start_date";
                const string endDateControlId = "rental_end_date";
                //currenly we support only this format
                const string datePickerFormat = "mm/dd/yy";

                <div class="form-group row">
                    <div class="col-md-3">
                        <div class="label-wrapper">
                            <label class="col-form-label">
                                @T("Products.RentalStartDate")
                            </label>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group input-group-required">
                            <input id="@(startDateControlId)" name="@(startDateControlId)" type="text" class="form-control" />
                            <div class="input-group-btn">
                                <nop-required />
                            </div>
                        </div>
                        <script>
                            $(document).ready(function() {
                                $("#@(startDateControlId)").datepicker({ dateFormat: "@datePickerFormat" });
                            });
                        </script>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-3">
                        <div class="label-wrapper">
                            <label class="col-form-label">
                                @T("Products.RentalEndDate")
                            </label>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="input-group input-group-required">
                            <input id="@(endDateControlId)" name="@(endDateControlId)" type="text" class="form-control" />
                            <div class="input-group-btn">
                                <nop-required />
                            </div>
                        </div>
                        <script>
                            $(document).ready(function() {
                                $("#@(endDateControlId)").datepicker({ dateFormat: "@datePickerFormat" });
                            });
                        </script>
                    </div>
                </div>
            }
        </div>
    </div>
}